﻿<%@ Page Language="C#" MasterPageFile="~/Detail.master" AutoEventWireup="true" CodeFile="Viewcart.aspx.cs" Inherits="shoping_viewcartDefault" Title="Untitled Page" %>

<%@ Register src="../usercontrol/other/Support.ascx" tagname="Support" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHeader" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceSlide" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceMain" Runat="Server">
    <div class="rowheader">
    <a href="http://localhost:13101/Vienthongsaigon/"> eShop</a> » 
    <span style="font-size: 12px;">Giỏ hàng</span>
</div>
 <div class="rowtitle">
        <div class="col1" style="border:none; width:50px">Stt</div>
        <div class="col2">Sản phẩm</div>
        <div class="col3">SL</div>
        <div class="col4">Đơn giá</div>
        <div class="col5">Thành tiền</div>
    </div>
<asp:UpdatePanel ID="upFeed" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID = "Updatecart" EventName = "Click" />
<asp:AsyncPostBackTrigger ControlID = "Emptycart" EventName = "Click" />
</Triggers>
 <ContentTemplate>
<asp:ListView ID="products" runat="server" OnItemDeleting = "products_ItemDeleting" >
 <LayoutTemplate>
 <div class ="cartborder">
    <div class ="cartrow" style ="font-weight: bold;">
        <asp:Literal ID="litHeader" runat="server"></asp:Literal>
    </div> 
    <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
    <div class ="cartrow" style ="font-weight: bold;">
        <div class ="pcartitemno">
        </div>
        <div class ="cartname" style ="text-align:right">
            <asp:Literal ID="litBottom" runat="server"></asp:Literal>
        </div>
        <div class ="cartquantity" style ="color: #E04139; margin:10px 0 0 5px">
            <asp:Literal ID="fQuantity" runat="server">0,000</asp:Literal>
        </div>
        <div class="cartprice"></div>
        <div class ="carttotal" style ="color: #E04139; margin-left:115px">
            <asp:Literal ID="fTotal" runat="server">0,000</asp:Literal>
        </div>
    </div> 
    
</div>
 </LayoutTemplate>
 <ItemTemplate>
 
<div  class ="cartrow" style =" background-color: #F7F7F7" >
    <div class ="pcartitemno">
              <span class="index"> <%# Container.DataItemIndex + 1 %></span>
            </div>
     <div class ="cartname">
        <asp:HiddenField ID="hdid" runat="server" Value = '<%#Eval("Id") + "," + Eval("Quantity")%>'  Visible = "true" />

         <asp:HiddenField ID="hdinfo" runat="server" Value = '<%#Eval("Id") + "," + Eval("Name") + "," + Eval("Price") + "," + Eval("Unit")%>'  Visible = "true" />
        <a href='<%# "http://localhost:2011/didong/product/" + Eval("URL") %>' title='<%#Eval("Name") %>'> <%#Eval("Name") %> </a>
    </div>
    <div class ="cartquantity">
        <asp:TextBox ID="inputquantity" runat="server"  CssClass ="cartinputquantity" MaxLength = "5" Text = '<%#Eval("Quantity")%>'></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="" Display="Dynamic" ControlToValidate="inputquantity" ValidationExpression="^[1-9]+$"></asp:RegularExpressionValidator>
    </div>
    
    <div class ="cartprice">
        <%#Eval("Price", "{0:0,0}")%>
    </div>
    
    <div class ="carttotal">
        <%#Eval("SubTotal", "{0:0,0}")%>
    </div>
    <div class = "cartdel">
         <asp:ImageButton ID=  "btnDelete"  CommandName = "Delete" CommandArgument = "Product_Id"  runat="server" ImageUrl ="http://localhost:2011/didong/images/design/delete_on.gif"  AlternateText = "Del"  Width = "20" Height ="20"  ToolTip = "Delete"/>
       
    </div>
</div>
 
</ItemTemplate>

</asp:ListView>   
  
<div class ="cartfunction">  
    <a href = "http://localhost:2011/didong/page/san-pham.html" title = "Tiếp tục mua hàng" >Tiếp tục mua hàng</a>
    <a href = "http://localhost:2011/didong/shoping/thanhtoan.html" title = "Đặt hàng" >Thanh toán</a> |
    <asp:LinkButton ID="Emptycart" runat="server" onclick="Emptycart_Click">Hủy giỏ hàng</asp:LinkButton>
  
    <asp:LinkButton ID="Updatecart" runat="server" onclick="Updatecart_Click">Cập nhật giỏ hàng</asp:LinkButton>
  
</div> 
  
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceRight" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ContentPlaceFooter" Runat="Server">
</asp:Content>

 